package de.koller.aframe.util.misc;

public class HashKey {

	public static int[] PRIMES = new int[] {
		982451653, (int)(Math.pow( 2, 32 ))
	};
			
	public static long generateKey( int v0, int v1, int v2, int v3, long seed ) {
		seed += 1;
		
		long k1 = v0 + seed;
		k1 <<= 32;
		k1 |= (long)v1;
		
		long k2 = v2 + seed;
		k2 <<= 48;
		k2 |= ((long)v3 << 16);
		k2 |= ((long)v2 >> 16);
		
		return (k1+k2)*PRIMES[0]*PRIMES[1] + seed;
	}
	
	public static void main( String[] args ) {
		long k = generateKey( 35, 67, 3, 0, 4 );
		System.out.println( Long.toHexString( k ) );
		
		k = generateKey( 35, 67, 4, 0, 4 );
		System.out.println( Long.toHexString( k ) );
	}
	
}
